#include <stdio.h>
#include <string.h>
#include <stdlib.h>

FILE *infile;

int handleArgs(int argc, char **argv)
{
  switch(argc)
  {
  case 1:
  	printf("Enter Equation:\n");
    break;
  case 2:
		if(strcmp(argv[1], "-h"))
    	infile = fopen(argv[1], "r");
    else
    	goto HELP;
    break;
  default:
HELP:
		printf("usege:\ncalca {<input file name>}\n");
    return 0;
  }
  return 1;
}

int main(int argc, char **argv)
{
   if(!handleArgs(argc, argv))
   {
     return 0;
   }
   yyset_in(infile);
   //yyset_out(body);
   yyparse();
   printf("Thank you for using calca\n");
   return 0;
}

